import { defineStore } from 'pinia';
import { ref } from 'vue';

/**
 * 用户时区，IANA格式，如 Asia/Shanghai
 * timezone
 */
/**
 * 时间显示格式,如 yyyy-MM-dd HH:mm:ss
 * timeFormat
 */
export const useTimeZoneStore = defineStore('timeZone', () => {
  const timeZone = ref<string>('');
  const timeFormat = ref<string>('');
  function setTimeZone(val: string) {
    timeZone.value = val;
  }
  function setTimeFormat(val: string) {
    timeFormat.value = val;
  }
  return { timeZone, setTimeZone, timeFormat, setTimeFormat };
});
